/**
 * @author: Gene
 * @age: 永远18岁的美少年
 * @Email： yangjianyun@58.com
 * @date: 2021-12-01 21:22:20
 * @description:  类
 */

class Person {
    name: string;

    getName(): void {
        console.log(this.name);
    }
}

let p1 = new Person();
p1.name = "Gene123"
p1.getName()

// ts 类中 定义存取器
class User {
    myName: string;

    constructor(myName: string) {
        this.myName = myName
    }

    get name() {
        return this.myName
    }

    set name(value) {
        this.myName = value
    }
}

let user = new User("杨洋")
user.name = 'Gene'
console.log(user.name);

/** ---------- ts 中的属性修饰符 ------------------*/
// readonly public protect  private

class Animal {
    public
}


/***/
export {}